package com.zlcx.tz.live.enums;

/**
 * @AUTHOR xhl
 * @CREATE 2019-04-18 18:02
 **/
public enum RoomJoinStatus {

    IN( "在房间内", 1),
    OUT( "离开房间", 2),
    KICKED( "被踢出", 3),
    BE_CLOSED( "强制解散", 4);

    RoomJoinStatus( String tips, int code) {
        this.tips = tips;
        this.code = code;
    }

    private String tips;
    private int code;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public static RoomJoinStatus getRoomJoinStatus(int code) {
        for (RoomJoinStatus field : RoomJoinStatus.values()) {
            if (code == field.getCode()) {
                return field;
            }
        }
        return null;
    }
}
